package com.java.manage.controller;

import com.java.common.model.Result;
import com.java.manage.model.Model;
import com.java.manage.service.ModelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 车辆车型
 */
@RestController
@RequestMapping("/model")
public class ModelController {
    @Autowired
    private ModelService modelService;

    @PostMapping("/list")
    public Result list(@RequestBody Model model) {
        return modelService.list(model);
    }

    @PostMapping("/save")
    public Result save(@RequestBody Model model) {
        return modelService.save(model);
    }

    @PostMapping("/modify")
    public Result modify(@RequestBody Model model) {
        return modelService.modify(model);
    }

    @PostMapping("/remove")
    public Result remove(int[] ids) {
        return modelService.remove(ids);
    }

    /**
     * 查询类型
     * @return
     */
    @PostMapping("/modelList")
    public Result modelList() {
        return modelService.modelList();
    }
}
